<?php

//======================================================================
// 调用方法
//======================================================================
require_once ('./response.php');

//-----------------------------------------------------
// 定义数组数据
//-----------------------------------------------------
  $data =array(
    'id'=>1,
    'name'=>'me',
    'data'=>array(1,2,3),
    'items'=>array('bananner'=>1,'orange'=>2)
  );
  
  /* 返回json编码格式调用 */
  //Response::jsonEncode('200','success',$data);
  
  /* 返回xml编码格式调用 */
  //Response::xmlEncode('200','success',$data);
  
  /* show方法json编码格式调用 */
  //Response::show('200','success',$data, 'json');
  //Response::show('200','success',$data, 'xml');
  //Response::show('200','success',$data, 'array');
  
  //通过临时传参的方式调用接口
  Response::show('200','success',$data); 
  //http://localhost/test_response.php?format=json